package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class MainActivity2 extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        //获取意图
        Intent intent = this.getIntent();
        //获取数据
        String Msg = intent.getStringExtra("Message");
        //显示数据
        TextView textView = findViewById(R.id.textView2);
        textView.setText(Msg);
    }
}